using System;

namespace Handrise.Mobile.BasicModal.Serialization
{
    /// <summary>
    /// Summary description for ObjectTable.
    /// </summary>
    public class ObjectTable : System.Collections.ArrayList
    {
        private const int TOP = 50;
        private const int WIDTH = 5;

        public ObjectTable(int len)
            : base(len)
        { }

        public int AddPlaceholder()
        {
            return this.Add(null);
        }

        public override int Add(object value)
        {
            if (this.Count >= TOP) this.RemoveRange(0, WIDTH);
            return base.Add(value);
        }
    }
}
